/**
 * OperateApply 业务逻辑实现类
 * @author yanwl
 * @date 2015-04-24
 */
package com.chnbst.bstyun.service.impl;

import java.util.List;
import java.util.Map;

import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;

import com.chnbst.bstyun.core.base.BaseService;
import com.chnbst.bstyun.core.common.helper.DaoHelper;
import com.chnbst.bstyun.model.pojo.OperateApply;
import com.chnbst.bstyun.service.OperateApplyService;

@Transactional
@Service
public class OperateApplyServiceImpl extends BaseService implements OperateApplyService {
	
	//声明命名空间
	private final static String nameSpace = "com.chnbst.bstyun.mapper.OperateApplyMapper";

	@Transactional(propagation=Propagation.REQUIRED,readOnly=false)
	@Override
	public boolean insertOperateApply(OperateApply operateApply) {
		return DaoHelper.insert(nameSpace, "insertOperateApply", operateApply);
	}

	@Transactional(propagation=Propagation.REQUIRED,readOnly=false)
	@Override
	public boolean deleteOperateApply(Long operateApplyId) {
		return DaoHelper.delete(nameSpace, "deleteOperateApply", operateApplyId);
	}

	@Transactional(propagation=Propagation.REQUIRED,readOnly=false)
	@Override
	public boolean updateOperateApply(OperateApply operateApply) {
		return DaoHelper.update(nameSpace, "updateOperateApply", operateApply);
	}

	@Transactional(propagation=Propagation.REQUIRED,readOnly=true)
	@Override
	public OperateApply selectOperateApply(Long operateApplyId) {
		return (OperateApply)DaoHelper.query(nameSpace, "selectOperateApply", operateApplyId);
	}

	@SuppressWarnings("unchecked")
	@Transactional(propagation=Propagation.REQUIRED,readOnly=true)
	@Override
	public List<OperateApply> selectOperateApplyList(Map<String, Object> map) {
		return (List<OperateApply>)DaoHelper.list(nameSpace, "selectOperateApplyList", map);
	}

	@Transactional(propagation=Propagation.REQUIRED,readOnly=true)
	@Override
	public int selectOperateApplyCount(Map<String, Object> map) {
		return DaoHelper.count(nameSpace, "selectOperateApplyCount", map);
	}
}
